<html>
<head><meta charset="utf-8"><title>building upstream LLVM · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html">building upstream LLVM</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209652311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209652311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209652311">(Sep 10 2020 at 14:22)</a>:</h4>
<p>Is anyone here familiar with building the upstream LLVM repository? It seems to building every single test with LTO, which is taking an enormous amount of time and memory</p>



<a name="209652321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209652321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209652321">(Sep 10 2020 at 14:22)</a>:</h4>
<p>is there a way to turn that off?</p>



<a name="209655353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209655353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209655353">(Sep 10 2020 at 14:40)</a>:</h4>
<p>Hmm, you can turn off lto via cmake <code>LLVM_ENABLE_LTO</code><br>
<a href="https://llvm.org/docs/CMake.html">https://llvm.org/docs/CMake.html</a><br>
but you may have to recompile :/<br>
I don't know of a way to compile llvm with lto and tests without lto that wouldn't require rebuilding a bunch of llvm stuff again for the tests (tests link against stuff from llvm iirc)</p>



<a name="209655577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209655577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209655577">(Sep 10 2020 at 14:41)</a>:</h4>
<p>if you're using ninja, set a limit on PARALLEL_LINK_JOBS too</p>



<a name="209658817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209658817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209658817">(Sep 10 2020 at 14:59)</a>:</h4>
<p>looking at my <code>CMakeCache.txt</code>, it looks like <code>LLVM_ENABLE_LTO</code> is off by default</p>



<a name="209658904"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209658904" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209658904">(Sep 10 2020 at 15:00)</a>:</h4>
<p>also, is building + testing supposed to take 56GB of storage???</p>



<a name="209659109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209659109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aaron Hill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209659109">(Sep 10 2020 at 15:01)</a>:</h4>
<p>I seem to recall a debug build of LLVM taking up an enormous amount of space</p>



<a name="209659142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209659142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209659142">(Sep 10 2020 at 15:01)</a>:</h4>
<p>it also helps if you build a single <code>libLLVM.so</code>, and <em>not</em> the various static <code>libLLVMFoo.a</code>, but I forget the exact options for that</p>



<a name="209659451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209659451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209659451">(Sep 10 2020 at 15:03)</a>:</h4>
<p>LLVM_LINK_SHARED=1 I think</p>



<a name="209685488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209685488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209685488">(Sep 10 2020 at 18:03)</a>:</h4>
<p><span class="user-mention" data-user-id="125294">@Aaron Hill</span> For our in-tree LLVM, my <code>build\x86_64-pc-windows-msvc\llvm</code> is 15GB.  So 56GB seems high, but I did disable some targets and our in-tree one probably builds less than upstream.</p>



<a name="209691238"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/building%20upstream%20LLVM/near/209691238" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/building.20upstream.20LLVM.html#209691238">(Sep 10 2020 at 18:45)</a>:</h4>
<p>Out of tree release build of clang+llvm+lld for windows-gnu takes less than 4 GiB.<br>
Around ~50 GiB is what I would expect of debug build.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>